# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-wand
pkgver=0.6.11
pkgrel=2
pkgdesc="Ctypes-based simple MagickWand API binding for Python"
url="https://github.com/emcconville/wand"
license=('MIT')
arch=('any')
depends=('imagemagick' 'libxml2' 'python')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-pytest-forked' 'python-pytest-xdist' 'python-memory-profiler'
              'python-psutil' 'ghostscript' 'librsvg')
source=("$pkgname-$pkgver.tar.gz::https://github.com/emcconville/wand/archive/$pkgver.tar.gz")
sha512sums=('996073d1b22fdd7924801114b24d803eb15e94c8980800a4ddb58110f72f9495aebc4de227db3a07af9c754a96c369c9ba7c7201442933ba653df1eefb74165f')

build() {
  cd wand-$pkgver
  python setup.py build
}

check() {
  cd wand-$pkgver
  pytest --deselect tests/image_methods_test.py::test_forward_fourier_transform \
         --deselect tests/image_methods_test.py::test_inverse_fourier_transform
}

package() {
  cd wand-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
